﻿@{
    ViewBag.Title = "SystemTransfer";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<script src="~/Content/js/select2/select2.min.js"></script>
<script type="text/javascript" >
    var keyValue = $.request("type");
    $(function () {
        gridList();

    });
    function getPostData() {
        return {
            Account: $("#txt_Account").val(),
            AccountName: $("#txt_AccountName").val(),
            ChangeType: $("#txt_ChangeType").val(),
            TMs: $("#txt_TMs").val(),
            TMe: $("#txt_TMe").val(),
        };
    }

    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            url: "/BusinessManage/D_MemberCharge/GetAllSaleGrid",
            height: $(window).height() - 96,
            colModel: [
                { label: "主键", name: "ID", hidden: true, key: true },
                { label: '类型', name: 'ChangeType', width: 180, align: "left"},
                { label: '会员ID', name: 'Account', width: 100, align: 'left' },
                { label: '会员姓名', name: 'AccountName', width: 100, align: 'left' },
                { label: '变动金额', name: 'ChangeAmount', width: 100, align: 'left' },
                { label: '触发人ID', name: 'TAccount', width: 100, align: 'left' },
                { label: '触发人姓名', name: 'TAccountName', width: 100, align: 'left' },
                { label: '备注', name: 'Remark', width: 100, align: 'left' },
                {
                    label: '记录时间', name: 'TriggerTime', width: 80, align: 'left',
                    formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s' }
                }
            ],
            pager: "#gridPager",
            sortname: 'TriggerTime desc',
            viewrecords: true,
            postData: getPostData(),
        });
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: getPostData(),
            }).trigger('reloadGrid');
        });
    }
</script>

<div class="topPanel">
    <div class="search">
        <table>
            <tr>
                <td>
                    <div class="input-group">
                        <input id="txt_Account" type="text" class="form-control" placeholder="会员ID" style="width: 200px;">
                        <input id="txt_AccountName" type="text" class="form-control" placeholder="会员姓名" style="width: 200px;">
                        <input id="txt_TMs" type="text" class="form-control" onclick="WdatePicker()" placeholder="起始时间" style="width: 200px;">
                        <input id="txt_TMe" type="text" class="form-control" onclick="WdatePicker()" placeholder="结束时间" style="width: 200px;">
                        @if (string.IsNullOrEmpty(@ViewBag.type))
                        {
                            <select id="txt_ChangeType" class="form-control" style="width: 200px;">
                                <option value="" selected>全部</option>
                                <option value="用户转账">用户转账</option>
                                <option value="用户充值" >用户充值</option>
                                <option value="消费组经理晋升经营组新组员">消费组经理晋升经营组新组员</option>
                                <option value="晋升消费组经理">晋升消费组经理</option>
                                <option value="公司进入一个点位">公司进入一个点位</option>
                            </select>
                        }
                        @if (!string.IsNullOrEmpty(@ViewBag.type))
                        {
                            <select id="txt_ChangeType" class="form-control" style="width: 200px;">
                                <option value="用户充值" selected>用户充值</option>
                            </select>
                        }                       
                        <span class="input-group-btn">
                            <button id="btn_search" type="button" class="btn  btn-primary"><i class="fa fa-search"></i></button>
                        </span>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div class="toolbar">
        @*<div class="btn-group">
            <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
        </div>*@
        <script>$('.toolbar').authorizeButton()</script>
    </div>
</div>
<div class="gridPanel">
    <table id="gridList"></table>
    <div id="gridPager"></div>
</div>